import service from "./service";
import qs from 'qs'
import { NEWS_KEY } from '../constant'
import NewsApi from '../api/news'


export const getNewsChannel = () => {
	return service({
		url: NewsApi.news_channel,
		params: {
			key: NEWS_KEY
		}
	})
}

export const getNewsList = ({ num = 10, start = 0, channel }) => {
	return service({
		url: NewsApi.news_get,
		method: 'post',
		params: {
			channel,
			num,
			start,
			key: NEWS_KEY
		}
	})
}

export const searchNews = ({ keyword }) => {
	return service({
		url: NewsApi.news_search,
		method: 'post',
		params: {
			keyword,
			key: NEWS_KEY
		}
	})
}
